package com.smartview.jboss.spring.dto;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import net.sf.json.JSONObject;

@Entity
@Table(name = "USERS")
public class UserDTO implements BasicDTO{
	
	@Id
	@Column(name = "id")
	private String id;
	@Column(name = "password")
	private String password;
	@Column(name = "name")
	private String name;
	@Column(name = "authority")
	private String authority;
	@Column(name="enable")
	private String enable;
	
	public String getEnable() {
		return enable;
	}


	public void setEnable(String enable) {
		this.enable = enable;
	}


	/**
	 * @return the level
	 */
	public String getAuthority() {
		return authority;
	}


	/**
	 * @param level the level to set
	 */
	public void setAuthority(String authority) {
		this.authority = authority;
	}


	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}


	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}


	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}


	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}


	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}


	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}


	public JSONObject toJson()
	{
		JSONObject jObj = new JSONObject();
		jObj.element("id", id);
		jObj.element("password", password);
		jObj.element("name", name);
		jObj.element("authority", authority);
		jObj.element("enable", enable);
	
		
		return jObj;
	}
/*	
	public String toString()
	{
		return "<ID : " + id + ", PASS : " + password + ">";
	}
*/
}
